package com.example.dao;

import com.example.entity.Params;
import com.example.entity.Study;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface StudyDao extends Mapper<Study> {

    List<Study> findBySearch(@Param("params") Params params);

    @Select("select study.*, type.name as typeName from study left join type on study.typeId = type.id")
    List<Study> findAll();
}
